# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=dependency-check
pkgver=10.0.2
pkgrel=1
pkgdesc="A tool that attempts to detect publicly disclosed vulnerabilities contained within a project's dependencies."
groups=('blackarch' 'blackarch-code-audit' 'blackarch-defensive'
        'blackarch-scanner')
arch=('any')
url='https://github.com/jeremylong/DependencyCheck/releases/'
license=('APACHE')
depends=('bash' 'java-environment')
source=("https://github.com/jeremylong/DependencyCheck/releases/download/v$pkgver/$pkgname-$pkgver-release.zip")
sha512sums=('2cbe3b26e323ce86e2b014d2e4356253d17df8881620f9126e0882616827bb2165af9700f7310242a5f662cf0562b6729a1d568d2dbbc50af00bbc23c799217c')

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname/bin
exec bash $pkgname.sh "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

